Skip to content

[codex] Bundle cookbook example data and remove yfinance#729

Draft
whenpoem wants to merge 1 commit intoPyPortfolio:mainfrom
whenpoem:codex-bundle-cookbook-data-remove-yfinance
Draft

[codex] Bundle cookbook example data and remove yfinance#729
whenpoem wants to merge 1 commit intoPyPortfolio:mainfrom
whenpoem:codex-bundle-cookbook-data-remove-yfinance

Conversation

@whenpoem
Copy link
Copy Markdown

Summary

  • add a packaged pypfopt.data module with loaders for bundled example prices, SPY prices, and Black-Litterman market caps
  • update the 5 cookbook notebooks to load bundled example data instead of downloading with yfinance
  • remove yfinance from the dev extra and add tests for the new data loaders

Why

Issue #716 tracks the cookbook notebooks' dependency on live yfinance downloads. That makes notebook CI depend on external network calls and changing upstream data. Bundling the example datasets keeps the notebooks reproducible and allows nbmake to run offline.

Impact

  • cookbook notebooks now run against stable packaged example data
  • package distributions include the example CSV and JSON assets used by the notebooks
  • developers no longer need yfinance installed to run the notebook test suite

Validation

  • uv run --python .venv\Scripts\python.exe pytest ./tests
  • uv run --python .venv\Scripts\python.exe pytest --reruns 3 --nbmake --nbmake-timeout=3600 -vv cookbook
  • uv run --python .venv\Scripts\python.exe python -m build --sdist --wheel --outdir dist-check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant